import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/update',
    method: 'post',
    data: row
  })
}
export const setInventory = (id , type , amount) => {
  return request({
    url: '/api/merchant-bmg/productcountinventory/transaction',
    method: 'post',
    params:{
      id,
      type,
      amount
    }
  })
}

export const getProductDetail = (id) => {
  return request({
    url: '/api/merchant-bmg/product/detail',
    method: 'get',
    params: {
      id
    }
  })
}
